
package cz.muni.fi.pa165.carpark.dao;

import cz.muni.fi.pa165.carpark.entities.ServiceCheck;
import cz.muni.fi.pa165.carpark.entities.Vehicle;
import java.util.List;

/**
 *
 * @author Viktor
 */
public interface ServiceCheckDAO {
    
    /**
     * Stores new serviceCheck into database. Id for the new serviceCheck is automatically
     * generated and stored into id attribute.
     * 
     * @param serviceCheck ServiceCheck to be created.
     * @throws NullPointerException when serviceCheck is null.
     * @throws IllegalArgumentException when serviceCheck is not valid
     * @throws DatabaseFailureException when db operation fails.
     */
    public void createCheck(ServiceCheck serviceCheck);
    
    /**
     * Returns serviceCheck with given id.
     * 
     * @return serviceCheck with given id or null if such serviceCheck does not exist.
     * @param id primary key of requested serviceCheck     
     * @throws DatabaseFailureException when db operation fails.
     */
    public ServiceCheck retrieveCheck(Long id);

    /**
     * Updates serviceCheck in database.
     * 
     * @param serviceCheck updated serviceCheck to be stored into database.     
     * @throws IllegalArgumentException when serviceCheck is not valid 
     * @throws IllegalEntityException when serviceCheck does not exist in the database or serviceCheck id is null
     * @throws DatabaseFailureException when db operation fails.
     */
    public void updateCheck(ServiceCheck serviceCheck);
    
     /**
     * Deletes serviceCheck from database. 
     * 
     * @param serviceCheck to be deleted from db.
     * @throws NullPointerException when serviceCheck is null.
     * @throws IllegalEntityException when serviceCheck does not exist in the database or serviceCheck id is null
     * @throws DatabaseFailureException when db operation fails.
     */
    public void deleteCheck(ServiceCheck serviceCheck);
    
    /**
     * Returns list of all ServiceChecks in the database.
     * 
     * @return list of all serviceChecks in database.
     * @throws DatabaseFailureException when db operation fails.
     */
    List<ServiceCheck> findAllServiceChecks();
    
    
     /**
     * Returns ServiceChecks
     * 
     * @param active = bool
     * @throws DatabaseFailureException when db operation fails.
     */
    public List<ServiceCheck> getServiceChecksByActive(boolean active);
   
     /**
     * Returns ServiceChecks
     * 
     * @param done = bool
     * @throws DatabaseFailureException when db operation fails.
     */
    public List<ServiceCheck> getServiceChecksByDone(boolean done);
   
    /**
     * Returns Vehicle of ServiceCheck
     * 
     * @param ServiceCheck
     * @throws DatabaseFailureException when db operation fails.
     */
    public Vehicle findServiceCheckVehicle(ServiceCheck check);
    
    }
